function bar() {
    console.log(myName); //Fog
}
function foo() {
    var myName = "Barry";
    bar();
    console.log(myName); //Barry
}
var myName = "Fog";
foo();